#include "exynos_4412.h"
int main()
{
	//将GPX1_2设置成输入功能
	GPX1.CON = GPX1.CON & (~(0xF << 8));
	//设置LED2引脚
	GPX2.CON = GPX2.CON & (~(0xF << 28)) | (0x1 << 28);

	while (1)
	{
		//按下按键
		if (!(GPX1.DAT & (1 << 2)))
		{
			printf("Key3 pressed!\n");
			//点亮LED2
			GPX2.DAT = GPX2.DAT | (1 << 7);
			while (!(GPX1.DAT & (1 << 2)));
		}
		else
		{
		
		}
		//再次按下按键
		if (!(GPX1.DAT & (1 << 2)))
		{
			printf("Key3 pressed!\n");
			//熄灭LED2
			GPX2.DAT = GPX2.DAT & (~(1 << 7));
			while (!(GPX1.DAT & (1 << 2)));
		}
		else
		{
		
		}
	}
	return 0;
}
